package umage.antlr;

import org.antlr.v4.runtime.TokenStream;

import umage.antlr.Java7Parser.MethodDeclarationContext;

public class ListenerTest extends Java7BaseListener {
	private Java7Parser parser;
	
	public ListenerTest(Java7Parser p) {
		parser = p;
	}
	
	@Override
	public void enterMethodDeclaration(MethodDeclarationContext ctx) {
		TokenStream tokens = parser.getTokenStream();
		System.out.println(ctx.Identifier() + tokens.getText(ctx.formalParameters()));
	}
	
}
